<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>uploadfy demo</title>
	<link rel="stylesheet" type="text/css" href="${ctx}/easyui/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="${ctx}/easyui/themes/icon.css">
	<script type="text/javascript" src="${ctx}/easyui/jquery.min.js"></script>
	<script type="text/javascript" src="${ctx}/easyui/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="${ctx}/easyui/locale/easyui-lang-zh_CN.js"></script>
	<script type="text/javascript" src="${ctx}/res/js/CRUD.js"></script>
	
	<link href="${ctx}/uploadify/uploadify.css" type="text/css" rel="stylesheet" />
	<script src="${ctx}/uploadify/jquery.uploadify.min.js" type="text/javascript" ></script>
<script type="text/javascript">
$(function() {
	$('#file_upload').uploadify({
		'queueSizeLimit':1, 
		'auto':false, 
		'swf': 'uploadify.swf',
		'uploader':'<%=path%>/common/upload;jsessionid=<%=session.getId()%>',
		'fileObjName' : 'file_upload',
		'fileSizeLimit' : '5000KB',
		'fileTypeDesc' : 'Image Files',
		'fileTypeExts' : '*.gif; *.jpg; *.png; *.doc;*.docx;*.xls;*.xlsx;*.rar;*.zip;*.txt;*.pdf;*.swf;*.flv',
		'onUploadSuccess' : function(file, data, response) {
			//alert('The file ' + file.name + ' was successfully uploaded with a response of ' + response + ':' + data); 
			var strData = $.parseJSON(data);
			alert(strData.obj.filePath);
		} 
	}); 
	$('#upload').click(function(){
		$('#file_upload').uploadify('upload','*');
	});
	
});
</script>
</head>
<body>
  <h1>sessionID:<%=session.getId() %></h1>  
<p><input type="file" name="file_upload" id="file_upload" /></p> 

<p><input id="upload" type="button" value="上传"/></p>
</body>
</html>